{% load static %}
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>Forgotten Password - 教务管理系统</title>
    <meta name="description" content="教务管理系统">
    <link rel="stylesheet" href="{% static "assets/bootstrap/css/bootstrap.min.css" %}">
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="{% static "assets/fonts/fontawesome-all.min.css" %}">
    <link rel="stylesheet" href="{% static "assets/fonts/font-awesome.min.css" %}">
    <link rel="stylesheet" href="{% static "assets/fonts/fontawesome5-overrides.min.css" %}">
</head>
<body class="bg-gradient-primary">
<div class="container">
    <div class="row justify-content-center">
        <div class="col-md-6 col-lg-12 col-xl-10">
            <div class="card shadow-lg o-hidden border-0 my-5">
                <div class="card-body p-0">
                    <div class="row">
                        <div class="col-lg-6 d-none d-lg-flex">
                            <div class="flex-grow-1 bg-password-image"
                                 style="background-image: url('#');"></div>
                        </div>
                        <div class="col-lg-6">
                            <div class="p-5">
                                <div class="text-center"><h4 class="text-dark mb-2">请输入你的新密码</h4>
                                    <p class="mb-4">考虑安全，注意不要和旧密码一样</p>
                                </div>
                                <form class="user" method="post" action="{% url 'reset' %}">
                                    {% csrf_token %}
                                    <div class="mb-3"><input type="text" class="form-control" readonly
                                                             value="{{ name }}" name="username">
                                    </div>
                                    <div class="mb-3"><input class="form-control" type="password" placeholder="请输入新密码"
                                                             name="password">
                                    </div>
                                    <div class="mb-3"><input type="password" class="form-control" placeholder="请确认"
                                                             name="confirm"></div>

                                    <div class="form-group">
                                        {% if messages %}
                                            {% for message in messages %}
                                                {% if message.tags == 'error' %}
                                                    <div class="alert alert-danger"
                                                         style="margin-top:10px">{{ message }}</div>
                                                {% endif %}
                                                {% if message.tags == 'success' %}
                                                    <div class="alert alert-success"
                                                         style="margin-top:10px">{{ message }}</div>
                                                {% endif %}
                                            {% endfor %}
                                        {% endif %}
                                    </div>

                                    <button class="btn btn-primary d-block btn-user w-100" type="submit">重置密码</button>
                                </form>
                                <div class="text-center">
                                    <hr>
                                </div>
                                <div class="text-center"></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="{% static "assets/bootstrap/js/bootstrap.min.js" %}"></script>
<script src="{% static "assets/js/chart.min.js" %}"></script>
<script src="{% static "assets/js/script.min.js" %}"></script>
</body>
</html>